<form id="edit-form" role="form" data-toggle="validator" method="POST" action="<?= Tools::siteurl("configvalue/edit/ids/{$row['id']}") ?>">
    <div class="row">
        <div class="col-xs-12">
            <div class="form-group">
                <label for="name" class="control-label">ID:</label>
                <input type="text" class="form-control" id="id" name="row[id]" value="<?= $row['id'] ?>" required="required" />
            </div>
            <div class="form-group">
                <label for="name" class="control-label">名称:</label>
                <input type="text" class="form-control" id="name" name="row[name]" value="<?= $row['name'] ?>" required="required" />
            </div>
            <?php if (substr($row['content'], 0, 1) == '{') { ?>
                <div class="form-group">
                    <label for="content" class="control-label">内容:</label>
                    <dl id="fieldlist" rel="<?= count(json_decode($row['content'], true)) ?>">
                        <dd>
                            <ins>字段</ins>
                            <ins>值</ins>
                        </dd>
                        <?php foreach (json_decode($row['content'], true) as $k => $v) { ?>
                            <dd class=" form-inline">
                                <input type="text" name="field[<?= $k ?>]" class="form-control" id="field-<?= $k ?>" value="<?= $k ?>" size="10" />
                                <input type="text" name="value[<?= $k ?>]" class="form-control" id="value-<?= $k ?>" value="<?= $v ?>" size="45" />
                                <span>×</span>
                            </dd>
                        <?php } ?>
                        <dd><a href="javascript:;" class="append">追加</a></dd>
                    </dl>
                </div>
            <?php } else { ?>
                <div class="form-group">
                    <label for="content" class="control-label">内容:</label>
                    <textarea name="row[content]" id="content" class="form-control" cols="30" rows="3"><?= $row['content'] ?></textarea>
                </div>
            <?php } ?>
            <div class="form-group">
                <label for="weigh" class="control-label">权重:</label>
                <input type="text" class="form-control" id="weigh" name="row[weigh]" value="<?= $row['weigh'] ?>" required="required" size="6" />
            </div>
        </div>
    </div>
</div>
<div class="form-group">
    <label for="content" class="control-label">状态:</label>
    <input type="radio" name="row[status]" value="normal" id="status-normal" <?= $row['status'] == 'normal' ? 'checked' : '' ?> />
    <label for="status-normal">正常</label>
    <input type="radio" name="row[status]" value="hidden" id="status-hidden" <?= $row['status'] == 'hidden' ? 'checked' : '' ?> />
    <label for="status-hidden">隐藏</label>
</div>
</form>